<script setup lang="ts">
const props = defineProps({
  user: {
    type: Object,
    requied: true,
    default: () => ({
      username: "",
      age: 0,
      email: "",
      phone: "",
    }),
  },
});
</script>
<template>
  <div class="user-info">
    <h1>用户信息</h1>
    <p>用户名：{{ user.username }}</p>
    <p>年龄：{{ user.age }}</p>
    <p>邮箱：{{ user.email }}</p>
    <p>手机：{{ user.phone }}</p>
  </div>
</template>
<style scoped>
.user-info {
  border: 1px solid #ccc;
  padding: 10px;
  width: 200px;
  margin-bottom: 10px;
}
</style>
